package com.artist.starter.controller;

import com.artist.starter.domain.ResponseData;
import com.artist.starter.domain.entity.SysUser;
import com.artist.starter.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserController {
    @Autowired
    private SysUserService service;

    @RequestMapping("/user/login")
    public ResponseData<SysUser> login(SysUser user){
        SysUser login = service.login(user.getUserName());
        return ResponseData.ok(login, "登录成功");
    }

}
